﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="d" uri="/WEB-INF/resource.tld" %>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  
</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <%@ include file="/WEB-INF/include/menu.jsp"%>

  <div class="container main-content">

    <div class="panel panel-default x-panel x-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/content">内容管理</a></li>
          <li class="active">活动管理</li>
        </ol>
      </div>

      <div class="panel-body">

        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

        <div class="col-xs-10 x-panel-layout-right">

          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire"></i>&nbsp;&nbsp;<span>活动管理&nbsp;-&nbsp;活动列表</span></h2>
            </div>
          </div>
          
         <div class="x-toolbar-wrapper top-margin-20 clearfix">
            <div class="btn-group pull-right">
               <a href="${ctx.host}/activities/create" class="btn btn-default x-btn btn-shadow btn-shadow-default">
                 <i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;添加活动
               </a>
               <a href="${ctx.host}/activities/search${not empty queryString ? '?'.concat(queryString) : ''}" data-target="#" data-toggle="modal" title="过滤查询" class="btn btn-default x-btn btn-shadow btn-shadow-default">
                 <i class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;过滤查询
               </a>               
            </div>
          </div>
          
          <div class="x-cards row" style="margin-top: 20px;">
            <div class="col-xs-4" style="padding: 0px;">
              <c:forEach var="activity" items="${activities}" step="3" begin="0">
                <div class="col-xs-12 card">
                  <div class="panel panel-default denver-panel denver-panel-layout">
                    <div class="panel-heading clearfix">
                      <span class="ellipsis" style="display:block; width: 220px; float: left;">${activity.name}</span>
                      <a class="pull-right" href="${ctx.host}/activities/${activity.id}"><i class="glyphicon glyphicon-menu-right"></i></a>
                    </div>
                    <div class="panel-body" style="padding: 0px;">
                      <div class="panel-img-wrapper">
                        <img alt="" src="${cloud.prod}/${activity.cover}-150">
                      </div>
                      <p style="padding: 10px; margin: 0px; border-bottom: 1px solid #ccc">
                      <c:if test="${activity.serial > 100}">
                        <label class="label label-success">已置顶</label>&nbsp;&nbsp; &nbsp;
                      </c:if>
                      <c:if test="${activity.status eq 'ONLINE' }">
                        <label class="label label-success">已上架</label>&nbsp;&nbsp; &nbsp;
                      </c:if>
                      </p>
                      <p style="padding: 10px; margin: 0px;height: 100px; word-break:break-word;">
                        ${activity.summary}
                      </p>
                      <p style="padding: 0 10px; color: #777;"><small>活动时间：${activity.beginDate }&nbsp;&nbsp;至&nbsp;&nbsp;${activity.endDate }</small></p>
                    </div>
                    <div class="panel-footer clearfix">
                      <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}" data-toggle="tooltip" data-placement="left" title="详情"><i class="glyphicon glyphicon-file"></i></a>
                      <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}/delete" data-target="#activity-delete"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="删除"><i class="glyphicon glyphicon-remove"></i></a>
                      <c:if test="${activity.status != 'OFFLINE' }">
                        <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}/stick" data-target="#activity-stick"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="置顶"><i class="glyphicon glyphicon-arrow-up"></i></a>
                      </c:if>
                      <c:if test="${activity.serial > 100}">
                        <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}/unstick" data-target="#activity-unstick"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="取消置顶"><i class="glyphicon glyphicon-arrow-down"></i></a>
                      </c:if>
                      <c:if test="${activity.status eq 'OFFLINE' }">
                        <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}/online" data-target="#activity-online"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="上架"><i class="glyphicon glyphicon-upload"></i></a>
                      </c:if>
                    </div>
                  </div>
                </div>
              </c:forEach>
            </div>
            <div class="col-xs-4" style="padding: 0px;">
              <c:forEach var="activity" items="${activities}" step="3" begin="1">
                <div class="col-xs-12 card">
                  <div class="panel panel-default denver-panel denver-panel-layout">
                    <div class="panel-heading clearfix">
                      <span class="ellipsis" style="display:block; width: 220px; float: left;">${activity.name}</span>
                      <a class="pull-right" href="${ctx.host}/activities/${activity.id}"><i class="glyphicon glyphicon-menu-right"></i></a>
                    </div>
                    <div class="panel-body" style="padding: 0px;">
                      <div class="panel-img-wrapper">
                        <img alt="" src="${cloud.prod}/${activity.cover}-150">
                      </div>
                      <p style="padding: 10px; margin: 0px; border-bottom: 1px solid #ccc">
                      <c:if test="${activity.serial > 100}">
                        <label class="label label-success">已置顶</label>&nbsp;&nbsp; &nbsp;
                      </c:if>
                      <c:if test="${activity.status eq 'ONLINE' }">
                        <label class="label label-success">已上架</label>&nbsp;&nbsp; &nbsp;
                      </c:if>
                      </p>
                      <p style="padding: 10px; margin: 0px;height: 100px; word-break:break-word;">
                        ${activity.summary}
                      </p>
                      <p style="padding: 0 10px; color: #777;"><small>活动时间：${activity.beginDate }&nbsp;&nbsp;至&nbsp;&nbsp;${activity.endDate }</small></p>
                    </div>
                    <div class="panel-footer clearfix">
                      <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}" data-toggle="tooltip" data-placement="left" title="详情"><i class="glyphicon glyphicon-file"></i></a>
                      <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}/delete" data-target="#activity-delete"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="删除"><i class="glyphicon glyphicon-remove"></i></a>
                      <c:if test="${activity.status != 'OFFLINE' }">
                        <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}/stick" data-target="#activity-stick"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="置顶"><i class="glyphicon glyphicon-arrow-up"></i></a>
                      </c:if>
                      <c:if test="${activity.serial > 100}">
                        <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}/unstick" data-target="#activity-unstick"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="取消置顶"><i class="glyphicon glyphicon-arrow-down"></i></a>
                      </c:if>
                      <c:if test="${activity.status eq 'OFFLINE' }">
                        <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}/online" data-target="#activity-online"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="上架"><i class="glyphicon glyphicon-upload"></i></a>
                      </c:if>
                    </div>
                  </div>
                </div>
              </c:forEach>
            </div>
            <div class="col-xs-4" style="padding: 0px;">
              <c:forEach var="activity" items="${activities}" step="3" begin="2">
                <div class="col-xs-12 card">
                  <div class="panel panel-default denver-panel denver-panel-layout">
                    <div class="panel-heading clearfix">
                      <span class="ellipsis" style="display:block; width: 220px; float: left;">${activity.name}</span>
                      <a class="pull-right" href="${ctx.host}/activities/${activity.id}"><i class="glyphicon glyphicon-menu-right"></i></a>
                    </div>
                    <div class="panel-body" style="padding: 0px;">
                      <div class="panel-img-wrapper">
                        <img alt="" src="${cloud.prod}/${activity.cover}-150">
                      </div>
                      <p style="padding: 10px; margin: 0px; border-bottom: 1px solid #ccc">
                      <c:if test="${activity.serial > 100}">
                        <label class="label label-success">已置顶</label>&nbsp;&nbsp; &nbsp;
                      </c:if>
                      <c:if test="${activity.status eq 'ONLINE' }">
                        <label class="label label-success">已上架</label>&nbsp;&nbsp; &nbsp;
                      </c:if>
                      </p>
                      <p style="padding: 10px; margin: 0px;height: 100px; word-break:break-word;">
                        ${activity.summary}
                      </p>
                      <p style="padding: 0 10px; color: #777;"><small>活动时间：${activity.beginDate }&nbsp;&nbsp;至&nbsp;&nbsp;${activity.endDate }</small></p>
                    </div>
                    <div class="panel-footer clearfix">
                      <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}" data-toggle="tooltip" data-placement="left" title="详情"><i class="glyphicon glyphicon-file"></i></a>
                      <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}/delete" data-target="#activity-delete"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="删除"><i class="glyphicon glyphicon-remove"></i></a>
                      <c:if test="${activity.status != 'OFFLINE' }">
                        <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}/stick" data-target="#activity-stick"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="置顶"><i class="glyphicon glyphicon-arrow-up"></i></a>
                      </c:if>
                      <c:if test="${activity.serial > 100}">
                        <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}/unstick" data-target="#activity-unstick"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="取消置顶"><i class="glyphicon glyphicon-arrow-down"></i></a>
                      </c:if>
                      <c:if test="${activity.status eq 'OFFLINE' }">
                        <a class="btn btn-default" href="${ctx.host}/activities/${activity.id}/online" data-target="#activity-online"  data-toggle="modal" data-toggle="tooltip" data-placement="left" title="上架"><i class="glyphicon glyphicon-upload"></i></a>
                      </c:if>
                    </div>
                  </div>
                </div>
              </c:forEach>
            </div>
          </div>
     
          <jsp:include page="/WEB-INF/include/page.jsp">
            <jsp:param name="url" value="activities" />
            <jsp:param name="queryString" value="${queryString}" />
          </jsp:include>
        
        </div>

      </div>
    </div>
  </div>

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource root="${ctx.resource}/build" type="script" src="js/page/content/activity/activity-list.js">
    <script type="text/javascript">
      require(['page/content/activity/activity-list'], function(page) {
        page.init()
      })
    </script>
  </d:resource>
  
</body>

</html>